import java.sql.Date;


public class FlightDate {

	private long flightDateID;
    private FlightSegment flightSegment;
    private Date departureDate;
    private boolean idSet = false;
    
    public FlightDate(FlightSegment flightSegment, Date departureDate) {
        this.flightSegment = flightSegment;
        this.departureDate = departureDate;
    }

	public void setFlightDateID(long flightDateID) {
		this.flightDateID = flightDateID;
        idSet = true;
	}

	public long getFlightDateID() {
		return flightDateID;
	}

    public boolean isIdSet() {
        return idSet;
    }

    public void setFlightSegment(FlightSegment flightSegment) {
        this.flightSegment = flightSegment;
    }

    public FlightSegment getFlightSegment() {
        return flightSegment;
    }

    public void setDepartureDate(Date departureDate) {
        this.departureDate = departureDate;
    }
    
    public Date getDepartureDate() {
        return departureDate;
    }
	
    @Override
    public boolean equals(Object fd) {
        if (fd instanceof FlightDate) {
            FlightDate fdOther = (FlightDate)fd;
            return fdOther.getFlightSegment().equals(flightSegment) && fdOther.getDepartureDate().equals(departureDate);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return flightSegment.hashCode() ^ departureDate.hashCode();
    }

}

